var pageIndex = 1
var pageSize = 5
var verified = new Vue({
  el: "#verified",
  data: {
    vlist: getVerifiedMsg(),
    vplist: getVerifiedPagin(pageIndex, pageSize)
  },
  methods: {
    deletVerifiedById(index) {
      $.ajax({
        url: "http://47.102.45.219:8080/Appoint/editVerifiedServlet/deleteVerifiedById",
        data: {
          "id": index
        },
        dataType: "json",
        async: false,
        success: function (data) {
          if (data.statu == 1) {
            layer.confirm('确认要删除吗？', function () {
              //发异步删除数据
              //verified.vplist = getVerifiedPagin(pageIndex, pageSize)
              xadmin.father_reload();
              layer.msg('已删除!', {
                icon: 1,
                time: 1000
              });
            });
          } else {
            layer.msg('删除失败!', {
              icon: 0,
              time: 1000
            });
          }
        }
      })
    },
    update(id) {
      xadmin.open('编辑', 'verified-edit.html?id=' + id, 600, 400)
    }
  }
})


function getVerifiedPagin(pageIndex, pageSize) {
  var listpagin
  $.ajax({
    url: 'http://47.102.45.219:8080/Appoint/editVerifiedServlet/getVerifiedPagin',
    data: {
      'pageIndex': pageIndex,
      'pageSize': pageSize
    },
    dataType: 'json',
    async: false,
    success: function (data) {
      if (data.statu) {
        listpagin = data.data
        // alert(listpagin)
      }

    }

  })
  return listpagin
}



function getVerifiedMsg() {
  //alert('a')
  var list
  $.ajax({
    url: "http://47.102.45.219:8080/Appoint/editVerifiedServlet/getVerifiedAll",
    dataType: "json",
    async: false,
    success: function (data) {
      if (data.statu == 1) {
        list = data.data
        //alert(list)
      } else {
        alert(data.msg)
      }

    }

  })
  return list
}